import { DataProvider } from "../../../../../fl/data/DataProvider";
import { PlayerMiniInfo } from "../../../model/PlayerMiniInfo";
import { FriendInfo } from "../../../model/FriendInfo";
import { Alert } from "../../../../../com/mui/controls/Alert";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { GameMapUtil } from "../../../scene/map/GameMapUtil";
import { MsgManager } from "../../../manager/MsgManager";
import { Language } from "../../../../../extend/language/Language";
import { EFriendFlag } from "../../../../../Message/Game/EFriendFlag";
import { MoveToBlackAlertWindow } from "../../friends/features/MoveToBlackAlertWindow";
import { CheckBoxWin } from "../alertwins/CheckBoxWin";
import { GameController } from "../../../mvc/GameController";
import { ChatModule } from "../../../../../modules/ChatModule";
import { EActiveType } from "../../../../../Message/Public/EActiveType";
import { EntityUtil } from "../../../scene/layer/utils/EntityUtil";
import { Cache } from "../../../cache/Cache";
type int = number;
//class PlayerOpMenuConst
    
    export  class PlayerOpMenuConst
    {
        

        
        {
            PlayerOpMenuConst.ChatOpMenu = new DataProvider([{"label": PlayerOpMenuConst.ChatForbid}, {"label": PlayerOpMenuConst.ChatUnForbid}, {"label": PlayerOpMenuConst.ChatPirvate}, {"label": PlayerOpMenuConst.AddFriend}, {"label": PlayerOpMenuConst.LookInfo}, {"label": PlayerOpMenuConst.Trade}, {"label": PlayerOpMenuConst.SendLetter}, {"label": PlayerOpMenuConst.CopyName}, {"label": PlayerOpMenuConst.InvitedToTeam}, {"label": PlayerOpMenuConst.ApplyToTeam}, {"label": PlayerOpMenuConst.InvitedToMember}, {"label": PlayerOpMenuConst.ApplyToMember}, {"label": PlayerOpMenuConst.MoveToBlackList}, {"label": PlayerOpMenuConst.Battle}, {"label": PlayerOpMenuConst.HandselFlower}, {"label": PlayerOpMenuConst.ChristmasCard}]);
            PlayerOpMenuConst.ChatPrivateOpMenu = new DataProvider([{"label": PlayerOpMenuConst.ChatForbid}, {"label": PlayerOpMenuConst.ChatUnForbid}, {"label": PlayerOpMenuConst.AddFriend}, {"label": PlayerOpMenuConst.LookInfo}, {"label": PlayerOpMenuConst.Trade}, {"label": PlayerOpMenuConst.SendLetter}, {"label": PlayerOpMenuConst.CopyName}, {"label": PlayerOpMenuConst.InvitedToTeam}, {"label": PlayerOpMenuConst.ApplyToTeam}, {"label": PlayerOpMenuConst.InvitedToMember}, {"label": PlayerOpMenuConst.ApplyToMember}, {"label": PlayerOpMenuConst.MoveToBlackList}, {"label": PlayerOpMenuConst.Battle}, {"label": PlayerOpMenuConst.HandselFlower}, {"label": PlayerOpMenuConst.ChristmasCard}]);
            PlayerOpMenuConst.FriendOpMenu = new DataProvider([{"label": PlayerOpMenuConst.ChatPirvate}, {"label": PlayerOpMenuConst.LookInfo}, {"label": PlayerOpMenuConst.Trade}, {"label": PlayerOpMenuConst.SendLetter}, {"label": PlayerOpMenuConst.CopyName}, {"label": PlayerOpMenuConst.InvitedToTeam}, {"label": PlayerOpMenuConst.ApplyToTeam}, {"label": PlayerOpMenuConst.InvitedToMember}, {"label": PlayerOpMenuConst.ApplyToMember}, {"label": PlayerOpMenuConst.Delete}, {"label": PlayerOpMenuConst.MoveToBlackList}, {"label": PlayerOpMenuConst.HandselFlower}, {"label": PlayerOpMenuConst.ChristmasCard}, {"label": PlayerOpMenuConst.AddIntimateFriend}]);
            PlayerOpMenuConst.IntimateFriendOpMenu = new DataProvider([{"label": PlayerOpMenuConst.ChatPirvate}, {"label": PlayerOpMenuConst.LookInfo}, {"label": PlayerOpMenuConst.Trade}, {"label": PlayerOpMenuConst.SendLetter}, {"label": PlayerOpMenuConst.CopyName}, {"label": PlayerOpMenuConst.InvitedToTeam}, {"label": PlayerOpMenuConst.ApplyToTeam}, {"label": PlayerOpMenuConst.InvitedToMember}, {"label": PlayerOpMenuConst.ApplyToMember}, {"label": PlayerOpMenuConst.Delete}, {"label": PlayerOpMenuConst.MoveToBlackList}, {"label": PlayerOpMenuConst.HandselFlower}, {"label": PlayerOpMenuConst.ChristmasCard}, {"label": PlayerOpMenuConst.LowerToFriend}]);
            PlayerOpMenuConst.EnemyOpMenu = new DataProvider([{"label": PlayerOpMenuConst.ChatPirvate}, {"label": PlayerOpMenuConst.LookInfo}, {"label": PlayerOpMenuConst.Trade}, {"label": PlayerOpMenuConst.SendLetter}, {"label": PlayerOpMenuConst.CopyName}, {"label": PlayerOpMenuConst.InvitedToTeam}, {"label": PlayerOpMenuConst.ApplyToTeam}, {"label": PlayerOpMenuConst.Delete}, {"label": PlayerOpMenuConst.MoveToBlackList}, {"label": PlayerOpMenuConst.HandselFlower}, {"label": PlayerOpMenuConst.ChristmasCard}]);
            PlayerOpMenuConst.BlackListOpMenu = new DataProvider([{"label": PlayerOpMenuConst.AddFriend}, {"label": PlayerOpMenuConst.LookInfo}, {"label": PlayerOpMenuConst.CopyName}, {"label": PlayerOpMenuConst.Delete}]);
            PlayerOpMenuConst.RecentListOpMenu = new DataProvider([{"label": PlayerOpMenuConst.ChatPirvate}, {"label": PlayerOpMenuConst.LookInfo}, {"label": PlayerOpMenuConst.Trade}, {"label": PlayerOpMenuConst.SendLetter}, {"label": PlayerOpMenuConst.CopyName}, {"label": PlayerOpMenuConst.InvitedToTeam}, {"label": PlayerOpMenuConst.ApplyToTeam}, {"label": PlayerOpMenuConst.InvitedToMember}, {"label": PlayerOpMenuConst.ApplyToMember}, {"label": PlayerOpMenuConst.Delete}, {"label": PlayerOpMenuConst.MoveToBlackList}, {"label": PlayerOpMenuConst.HandselFlower}, {"label": PlayerOpMenuConst.ChristmasCard}, {"label": PlayerOpMenuConst.AddIntimateFriend}]);
            PlayerOpMenuConst.GroupCaptainOpMenu = new DataProvider([{"label": PlayerOpMenuConst.AddFriend}, {"label": PlayerOpMenuConst.ChatPirvate}, {"label": PlayerOpMenuConst.LookInfo}, {"label": PlayerOpMenuConst.Trade}, {"label": PlayerOpMenuConst.SendLetter}, {"label": PlayerOpMenuConst.KickOutGroup}, {"label": PlayerOpMenuConst.AppointCaptain}, {"label": PlayerOpMenuConst.Battle}, {"label": PlayerOpMenuConst.HandselFlower}, {"label": PlayerOpMenuConst.ChristmasCard}]);
            PlayerOpMenuConst.GroupMemOpMenu = new DataProvider([{"label": PlayerOpMenuConst.AddFriend}, {"label": PlayerOpMenuConst.ChatPirvate}, {"label": PlayerOpMenuConst.LookInfo}, {"label": PlayerOpMenuConst.Trade}, {"label": PlayerOpMenuConst.Battle}, {"label": PlayerOpMenuConst.SendLetter}, {"label": PlayerOpMenuConst.HandselFlower}, {"label": PlayerOpMenuConst.ChristmasCard}]);
            PlayerOpMenuConst.RoleCaptainOpMenu = new DataProvider([{"label": PlayerOpMenuConst.LeaveGroup}, {"label": PlayerOpMenuConst.ChangeFace}]);
            PlayerOpMenuConst.RoleMemOpMenu = new DataProvider([{"label": PlayerOpMenuConst.LeaveGroup}, {"label": PlayerOpMenuConst.ChangeFace}]);
            PlayerOpMenuConst.RoleNoGroupOpMenu = new DataProvider([{"label": PlayerOpMenuConst.CreateGroup}, {"label": PlayerOpMenuConst.ChangeFace}]);
            PlayerOpMenuConst.NearbyTeamOpMenu = new DataProvider([{"label": PlayerOpMenuConst.ApplyToTeam}, {"label": PlayerOpMenuConst.CaptainChat}, {"label": PlayerOpMenuConst.LookCaptainInfo}, {"label": PlayerOpMenuConst.HandselFlower}, {"label": PlayerOpMenuConst.ChristmasCard}]);
            PlayerOpMenuConst.NearbyPlayerOpMenu = new DataProvider([{"label": PlayerOpMenuConst.InvitedToTeam}, {"label": PlayerOpMenuConst.AddFriend}, {"label": PlayerOpMenuConst.ChatPirvate}, {"label": PlayerOpMenuConst.LookInfo}, {"label": PlayerOpMenuConst.Trade}, {"label": PlayerOpMenuConst.HandselFlower}, {"label": PlayerOpMenuConst.ChristmasCard}]);
            PlayerOpMenuConst.GuildOpMenu = new DataProvider([{"label": PlayerOpMenuConst.LookMember}, {"label": PlayerOpMenuConst.ApplyToMember}, {"label": PlayerOpMenuConst.CongratulateMember}]);
            PlayerOpMenuConst.PublicCrossChatOpMenu = new DataProvider([{"label": PlayerOpMenuConst.ChatPirvate}, {"label": PlayerOpMenuConst.LookInfo}, {"label": PlayerOpMenuConst.CopyName}, {"label": PlayerOpMenuConst.Battle}, {"label": PlayerOpMenuConst.InvitedToTeam}, {"label": PlayerOpMenuConst.ApplyToTeam}, {"label": PlayerOpMenuConst.HandselFlower}]);
            PlayerOpMenuConst.DominionChatOpMenu = new DataProvider([{"label": PlayerOpMenuConst.CopyName}]);
            PlayerOpMenuConst.isNotTipDel = false;
        }

        public static getEnabeldAttri(arg1: DataProvider, arg2: PlayerMiniInfo): DataProvider
        {
            var loc3=null;
            var loc4=false;
            var loc5=null;
            var loc1=new DataProvider();
            var loc2=0;
            while (loc2 < arg1.length) 
            {
                loc3 = arg1.getItemAt(loc2);
                if (loc4 = PlayerOpMenuConst.getOpEnabled(loc3["label"], arg2)) 
                {
                    loc5 = {"label": loc3["label"], "enabled": loc4};
                    loc1.addItem(loc5);
                }
                ++loc2;
            }
            return loc1;
        }

        /* internal  */static isAtSameProxy(arg1: PlayerMiniInfo): Boolean
        {
            return arg1.entityId.typeEx2 == PlayerOpMenuConst.cache.role.entityInfo.entityId.typeEx2;
        }

        public static Opearte(arg1: string, arg2: PlayerMiniInfo, arg3: FriendInfo=null): void
        {
            var opName: string;
            var playerMiniInfo: PlayerMiniInfo;
            var friendInfo: FriendInfo=null;
            var tipText: string;
            var confirmDelete: Function;
            var confirmMoveToBlackList: Function;

            var loc1;
            confirmDelete = null;
            confirmMoveToBlackList = null;
            opName = arg1;
            playerMiniInfo = arg2;
            friendInfo = arg3;
            confirmDelete = (arg1: int, arg2: Boolean): void
            {
                PlayerOpMenuConst.isNotTipDel = arg2;
                if (arg1 == Alert.OK) 
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FriendDelete, friendInfo));
                }
                return;
            }
            confirmMoveToBlackList = (arg1: int): void
            {
                if (arg1 == Alert.OK) 
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FriendMoveToBlackList, playerMiniInfo));
                }
                return;
            }
            tipText = "";
            var loc2=opName;
            switch (loc2) 
            {
                case PlayerOpMenuConst.ChatForbid:
                {
                    if (PlayerOpMenuConst.cache.title.isGM) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.GMForbidTalk, playerMiniInfo));
                    }
                    else 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CountryForbidTalking, playerMiniInfo));
                    }
                    break;
                }
                case PlayerOpMenuConst.ChatUnForbid:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GMUnForbidTalk, playerMiniInfo));
                    break;
                }
                case PlayerOpMenuConst.CaptainChat: case PlayerOpMenuConst.ChatPirvate:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ChatPrivate, playerMiniInfo));
                    break;
                }
                case PlayerOpMenuConst.LookCaptainInfo: case PlayerOpMenuConst.LookInfo:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.playerMenuLookPlayerInfo, playerMiniInfo.entityId));
                    break;
                }
                case PlayerOpMenuConst.AddFriend:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FriendRequestAddFriend, {"name": playerMiniInfo.playerName}));
                    break;
                }
                case PlayerOpMenuConst.AddIntimateFriend:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FriendRequestAddIntimateFriend, {"name": playerMiniInfo.playerName}));
                    break;
                }
                case PlayerOpMenuConst.LowerToFriend:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FriendRequestLowerToFriend, {"name": playerMiniInfo.playerName}));
                    break;
                }
                case PlayerOpMenuConst.Trade:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.TradeRequest, playerMiniInfo.entityId));
                    break;
                }
                case PlayerOpMenuConst.SendLetter:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.MailSendToPlayer, playerMiniInfo.playerName));
                    break;
                }
                case PlayerOpMenuConst.CopyName:
                {
                    flash.system.System.setClipboard(playerMiniInfo.playerName);
                    break;
                }
                case PlayerOpMenuConst.InvitedToTeam:
                {
                    if (GameMapUtil.isCrossGroupMap()) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CrossGroup_DoInvite, playerMiniInfo.entityId));
                    }
                    else 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.Group_DoInvite, playerMiniInfo.entityId));
                    }
                    break;
                }
                case PlayerOpMenuConst.ApplyToTeam:
                {
                    if (GameMapUtil.isCrossGroupMap()) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CrossGroup_DoApply, playerMiniInfo.entityId));
                    }
                    else 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.Group_DoApply, playerMiniInfo.entityId));
                    }
                    break;
                }
                case PlayerOpMenuConst.InvitedToMember:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildInvite, {"toPlayerId": playerMiniInfo.playerId}));
                    break;
                }
                case PlayerOpMenuConst.ApplyToMember:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildApplyPlayersGuild, playerMiniInfo.playerId));
                    break;
                }
                case PlayerOpMenuConst.MoveToBlackList:
                {
                    if (friendInfo && PlayerOpMenuConst.cache.marry.playerMarry && PlayerOpMenuConst.cache.marry.playerMarry.mate.entityId.id == friendInfo.friendPlayerInfo.playerId) 
                    {
                        MsgManager.showRollTipsMsg(Language.getString(40387));
                        break;
                    }
                    if (friendInfo && friendInfo.friendFlag == EFriendFlag._EFriendFlagFriend || PlayerOpMenuConst.isFriend(playerMiniInfo)) 
                    {
                        tipText = Language.getString(42740);
                    }
                    tipText = tipText + Language.getStringByParam(42741, playerMiniInfo.playerName);
                    if (friendInfo && friendInfo.friendFlag == EFriendFlag._EFriendFlagFriend && friendInfo.intimate >= 100) 
                    {
                        MoveToBlackAlertWindow.instance.playerMiniInfo = playerMiniInfo;
                        MoveToBlackAlertWindow.instance.friendInfo = friendInfo;
                        MoveToBlackAlertWindow.instance.setMode(MoveToBlackAlertWindow.ValidateMode, MoveToBlackAlertWindow.MoveToBlack);
                        MoveToBlackAlertWindow.instance.show();
                    }
                    else 
                    {
                        Alert.show(tipText, null, Alert.OK | Alert.CANCEL, null, confirmMoveToBlackList);
                    }
                    break;
                }
                case PlayerOpMenuConst.Delete:
                {
                    if (friendInfo && PlayerOpMenuConst.cache.marry.playerMarry && PlayerOpMenuConst.cache.marry.playerMarry.mate.entityId.id == friendInfo.friendPlayerInfo.playerId) 
                    {
                        if (friendInfo.friendFlag == EFriendFlag._EFriendFlagFriend) 
                        {
                            MsgManager.showRollTipsMsg(Language.getString(40387));
                            break;
                        }
                    }
                    if (friendInfo && friendInfo.friendFlag == EFriendFlag._EFriendFlagFriend || !friendInfo && PlayerOpMenuConst.isFriend(playerMiniInfo)) 
                    {
                        tipText = Language.getString(42742);
                    }
                    tipText = tipText + Language.getString(42743);
                    if (friendInfo && friendInfo.friendFlag == EFriendFlag._EFriendFlagFriend && friendInfo.intimate >= 1000) 
                    {
                        MoveToBlackAlertWindow.instance.playerMiniInfo = playerMiniInfo;
                        MoveToBlackAlertWindow.instance.friendInfo = friendInfo;
                        MoveToBlackAlertWindow.instance.setMode(MoveToBlackAlertWindow.ValidateMode, MoveToBlackAlertWindow.Del);
                        MoveToBlackAlertWindow.instance.show();
                    }
                    else if (PlayerOpMenuConst.isNotTipDel) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.FriendDelete, friendInfo));
                    }
                    else 
                    {
                        Alert.alertWinRenderer = CheckBoxWin;
                        Alert.show(tipText, null, Alert.OK | Alert.CANCEL, null, confirmDelete);
                    }
                    break;
                }
                case PlayerOpMenuConst.LeaveGroup:
                {
                    if (GameMapUtil.isCrossGroupMap()) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CrossGroup_DoLeaveGroup, null));
                    }
                    else 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.Group_DoLeaveGroup, null));
                    }
                    break;
                }
                case PlayerOpMenuConst.KickOutGroup:
                {
                    if (GameMapUtil.isCrossGroupMap()) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CrossGroup_DoKickOut, playerMiniInfo.entityId));
                    }
                    else 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.Group_DoKickOut, playerMiniInfo.entityId));
                    }
                    break;
                }
                case PlayerOpMenuConst.CreateGroup:
                {
                    if (GameMapUtil.isCrossGroupMap()) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CrossGroup_DoCreateGroup));
                    }
                    else 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.Group_DoCreateGroup));
                    }
                    break;
                }
                case PlayerOpMenuConst.ChangeFace:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.OpenChangeHeadIconWindow));
                    break;
                }
                case PlayerOpMenuConst.AppointCaptain:
                {
                    if (GameMapUtil.isCrossGroupMap()) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CrossGroup_DoChangeCaptain, playerMiniInfo.miniPlayer));
                    }
                    else 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.Group_DoChangeCaptain, playerMiniInfo.miniPlayer));
                    }
                    break;
                }
                case PlayerOpMenuConst.HandselFlower:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FlowerOpenHandselFlower, playerMiniInfo));
                    break;
                }
                case PlayerOpMenuConst.ChristmasCard:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ChristmasCardOpenHandselChristmasCard, playerMiniInfo.playerName));
                    break;
                }
                case PlayerOpMenuConst.LookMember:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildInfoWindowOpen, playerMiniInfo.extendsObj["guildId"]));
                    break;
                }
                case PlayerOpMenuConst.CongratulateMember:
                {
                    (GameController.chat.view as ChatModule).addInputText(Language.getStringByParam(42744, playerMiniInfo.playerName));
                    break;
                }
                case PlayerOpMenuConst.Battle:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.BattleApply, playerMiniInfo));
                    break;
                }
            }
            return;
        }

        public static getOpEnabled(arg1: string, arg2: PlayerMiniInfo): Boolean
        {
            var loc1=arg1;
            switch (loc1) 
            {
                case PlayerOpMenuConst.ChatForbid:
                {
                    return !PlayerOpMenuConst.isSelf(arg2) && (PlayerOpMenuConst.cache.title.isGM || PlayerOpMenuConst.cache.country.isForbidTalkPrivilege);
                }
                case PlayerOpMenuConst.ChatUnForbid:
                {
                    return PlayerOpMenuConst.cache.title.isGM;
                }
                case PlayerOpMenuConst.ChatPirvate:
                {
                    if (PlayerOpMenuConst.isSelf(arg2) || !arg2.online) 
                    {
                        return false;
                    }
                    return true;
                }
                case PlayerOpMenuConst.LookInfo:
                {
                    return PlayerOpMenuConst.isSelf(arg2) || !arg2.online ? false : true;
                }
                case PlayerOpMenuConst.AddFriend:
                {
                    return !PlayerOpMenuConst.isAtSameServer(arg2) || PlayerOpMenuConst.isSelf(arg2) || PlayerOpMenuConst.isFriend(arg2) || !arg2.online ? false : true;
                }
                case PlayerOpMenuConst.AddIntimateFriend:
                {
                    return !PlayerOpMenuConst.isAtSameServer(arg2) || PlayerOpMenuConst.isSelf(arg2) || !PlayerOpMenuConst.isFriend(arg2) || PlayerOpMenuConst.isIntimateFriend(arg2) ? false : true;
                }
                case PlayerOpMenuConst.LowerToFriend:
                {
                    return !PlayerOpMenuConst.isAtSameServer(arg2) || PlayerOpMenuConst.isSelf(arg2) || !PlayerOpMenuConst.isIntimateFriend(arg2) ? false : true;
                }
                case PlayerOpMenuConst.Trade:
                {
                    return !PlayerOpMenuConst.isAtSameServer(arg2) || PlayerOpMenuConst.isSelf(arg2) || !arg2.online ? false : true;
                }
                case PlayerOpMenuConst.SendLetter:
                {
                    return !PlayerOpMenuConst.isAtSameServer(arg2) || PlayerOpMenuConst.isSelf(arg2) ? false : true;
                }
                case PlayerOpMenuConst.CopyName:
                {
                    return true;
                }
                case PlayerOpMenuConst.InvitedToTeam:
                {
                    return PlayerOpMenuConst.isCanInvitedToTeam(arg2);
                }
                case PlayerOpMenuConst.ApplyToTeam:
                {
                    return PlayerOpMenuConst.isCanApplyToTeam(arg2);
                }
                case PlayerOpMenuConst.InvitedToMember:
                {
                    return PlayerOpMenuConst.isAtSameServer(arg2) && PlayerOpMenuConst.cache.guild.canInvite(arg2);
                }
                case PlayerOpMenuConst.ApplyToMember:
                {
                    return PlayerOpMenuConst.isAtSameServer(arg2) && PlayerOpMenuConst.cache.guild.canApply(arg2);
                }
                case PlayerOpMenuConst.MoveToBlackList:
                {
                    return PlayerOpMenuConst.isInBlackList(arg2) || !PlayerOpMenuConst.isAtSameServer(arg2) || PlayerOpMenuConst.isSelf(arg2) ? false : true;
                }
                case PlayerOpMenuConst.Delete:
                {
                    return !PlayerOpMenuConst.isAtSameServer(arg2) || PlayerOpMenuConst.isSelf(arg2) ? false : true;
                }
                case PlayerOpMenuConst.HandselFlower:
                {
                    return arg2.online;
                }
                case PlayerOpMenuConst.ChristmasCard:
                {
                    return arg2.online && !PlayerOpMenuConst.isSelf(arg2) && PlayerOpMenuConst.isAtSameServer(arg2) && PlayerOpMenuConst.cache.active.isActiveInEffect(EActiveType._EActiveTypeChristmasCard);
                }
                case PlayerOpMenuConst.LookMember:
                {
                    return PlayerOpMenuConst.isAtSameServer(arg2) && arg2.extendsObj.hasOwnProperty("guildId");
                }
                case PlayerOpMenuConst.CongratulateMember:
                {
                    return true;
                }
                case PlayerOpMenuConst.Battle:
                {
                    return !GameMapUtil.isCanBattle() || PlayerOpMenuConst.isSelf(arg2) || !arg2.online ? false : true;
                }
                default:
                {
                    return true;
                }
            }
        }

        /* internal  */static isAtSameServer(arg1: PlayerMiniInfo): Boolean
        {
            return arg1.entityId.typeEx2 == PlayerOpMenuConst.cache.role.entityInfo.entityId.typeEx2 && arg1.entityId.typeEx == PlayerOpMenuConst.cache.role.entityInfo.entityId.typeEx;
        }

        /* internal  */static isSelf(arg1: PlayerMiniInfo): Boolean
        {
            return EntityUtil.equal(arg1.entityId, PlayerOpMenuConst.cache.role.entityInfo.entityId) ? true : false;
        }

        /* internal  */static isInBlackList(arg1: PlayerMiniInfo): Boolean
        {
            return PlayerOpMenuConst.cache.friend.isInBlackList(arg1.playerName);
        }

        /* internal  */static isFriend(arg1: PlayerMiniInfo): Boolean
        {
            return PlayerOpMenuConst.cache.friend.isFriend(arg1.playerName);
        }

        /* internal  */static isIntimateFriend(arg1: PlayerMiniInfo): Boolean
        {
            return PlayerOpMenuConst.cache.friend.isIntimateFriend(arg1.playerName);
        }

        /* internal  */static isCanInvitedToTeam(arg1: PlayerMiniInfo): Boolean
        {
            if (PlayerOpMenuConst.isSelf(arg1) || !arg1.online) 
            {
                return false;
            }
            var loc1=GameMapUtil.isCrossGroupMap();
            if (loc1) 
            {
                return PlayerOpMenuConst.cache.crossGroup.isInGroup && !PlayerOpMenuConst.cache.crossGroup.isCaptain && !PlayerOpMenuConst.cache.crossGroup.memberInvite ? false : true;
            }
            return !PlayerOpMenuConst.isAtSameServer(arg1) || PlayerOpMenuConst.cache.group.isInGroup && !PlayerOpMenuConst.cache.group.isCaptain && !PlayerOpMenuConst.cache.group.memberInvite ? false : true;
        }

        /* internal  */static isCanApplyToTeam(arg1: PlayerMiniInfo): Boolean
        {
            if (PlayerOpMenuConst.isSelf(arg1) || !arg1.online) 
            {
                return false;
            }
            var loc1=GameMapUtil.isCrossGroupMap();
            if (loc1) 
            {
                return PlayerOpMenuConst.cache.crossGroup.players.length > 0 ? false : true;
            }
            return !PlayerOpMenuConst.isAtSameServer(arg1) || PlayerOpMenuConst.cache.group.players.length > 0 ? false : true;
        }

        public static /* const */ApplyToTeam: string=Language.getString(42709);

        public static /* const */InvitedToMember: string=Language.getString(42710);

        public static /* const */ApplyToMember: string=Language.getString(42711);

        public static /* const */MoveToBlackList: string=Language.getString(42712);

        public static /* const */LeaveGroup: string=Language.getString(42713);

        public static /* const */KickOutGroup: string=Language.getString(42714);

        public static /* const */AppointCaptain: string=Language.getString(42715);

        public static /* const */CaptainChat: string=Language.getString(42716);

        public static /* const */LookCaptainInfo: string=Language.getString(42717);

        public static /* const */HandselFlower: string=Language.getString(42718);

        public static /* const */LookMember: string=Language.getString(42719);

        public static /* const */Battle: string=Language.getString(42721);

        public static /* const */ChristmasCard: string=Language.getString(42722);

        public static /* const */CreateGroup: string=Language.getString(42745);

        public static /* const */ChangeFace: string=Language.getString(70511);

        public static /* const */Delete: string=Language.getString(42723);

        /* internal */ static /* const */cache: Cache=Cache.instance;

        public static /* const */LowerToFriend: string=Language.getString(42747);

        public static /* const */ChatForbid: string=Language.getString(42700);

        public static /* const */ChatUnForbid: string=Language.getString(42701);

        public static /* const */ChatPirvate: string=Language.getString(42702);

        public static /* const */LookInfo: string=Language.getString(42703);

        public static /* const */CongratulateMember: string=Language.getString(42720);

        public static /* const */AddFriend: string=Language.getString(42704);

        public static /* const */AddIntimateFriend: string=Language.getString(42746);

        public static /* const */Trade: string=Language.getString(42705);

        public static /* const */SendLetter: string=Language.getString(42706);

        public static /* const */CopyName: string=Language.getString(42707);

        public static /* const */InvitedToTeam: string=Language.getString(42708);

        public static /* var */RoleNoGroupOpMenu: DataProvider;

        public static /* var */NearbyTeamOpMenu: DataProvider;

        public static /* var */NearbyPlayerOpMenu: DataProvider;

        public static /* var */ChatOpMenu: DataProvider;

        public static /* var */PublicCrossChatOpMenu: DataProvider;

        public static /* var */DominionChatOpMenu: DataProvider;

        public static /* var */ChatPrivateOpMenu: DataProvider;

        /* internal */ static /* var */isNotTipDel: Boolean=false;

        public static /* var */FriendOpMenu: DataProvider;

        public static /* var */IntimateFriendOpMenu: DataProvider;

        public static /* var */EnemyOpMenu: DataProvider;

        public static /* var */BlackListOpMenu: DataProvider;

        public static /* var */RecentListOpMenu: DataProvider;

        public static /* var */GroupCaptainOpMenu: DataProvider;

        public static /* var */GroupMemOpMenu: DataProvider;

        public static /* var */RoleCaptainOpMenu: DataProvider;

        public static /* var */RoleMemOpMenu: DataProvider;

        public static /* var */GuildOpMenu: DataProvider;
    }
